class CreateItems < ActiveRecord::Migration
  def self.up
    create_table :testitems, :id => false do |t|
      t.column    :item_id, :serial
      t.string    :name, :limit => 40
      t.text      :description

      t.references :firm, :null => false

      # t.primary_key [:firm_id,:item_id]

      t.timestamps
      
#      t.index([:item_id,:firm_id]) # , :unique => false, :name => "moj_index")
    end

    add_index :testitems, [:item_id,:firm_id], :unique => true, :name => "moj_index"
#    create table :tests, :id => false do 

  end

  def self.down
    drop_table :items
  end
end
